package com.chd.driversystem.domain;

import android.graphics.Bitmap;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Transient;
import org.greenrobot.greendao.annotation.Unique;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by feiyu on 17-5-18.
 */
@Entity(indexes = {@Index(value = "id ASC",unique = true)})
public class Ranking {
    @Id(autoincrement = true)
    private Long id;
    @Unique
    private Long userId;    //用户id

    private String avator;  //头像
    private String name;    //姓名
    private Integer score; //总分

    @Transient
    private Bitmap btAvator;

    @Generated(hash = 1089813145)
    public Ranking(Long id, Long userId, String avator, String name,
            Integer score) {
        this.id = id;
        this.userId = userId;
        this.avator = avator;
        this.name = name;
        this.score = score;
    }

    @Generated(hash = 1361760905)
    public Ranking() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return this.userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAvator() {
        return this.avator;
    }

    public void setAvator(String avator) {
        this.avator = avator;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getScore() {
        return this.score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public Bitmap getBtAvator() {
        return btAvator;
    }

    public void setBtAvator(Bitmap btAvator) {
        this.btAvator = btAvator;
    }

    @Override
    public String toString() {
        return "Ranking{" +
                "id=" + id +
                ", userId=" + userId +
                ", avator='" + avator + '\'' +
                ", name='" + name + '\'' +
                ", score=" + score +
                ", btAvator=" + btAvator +
                '}';
    }
}
